import { Router } from 'express';
import { authenticate } from '@/middleware/auth';
import {
  createExpense,
  getExpenses,
  getExpenseById,
  updateExpense,
  deleteExpense,
} from '@/controllers/expenseController';

const router = Router();

// 所有费用记录路由都需要认证
router.use(authenticate);

// 费用记录管理路由
router.post('/', createExpense);
router.get('/', getExpenses);
router.get('/:id', getExpenseById);
router.put('/:id', updateExpense);
router.delete('/:id', deleteExpense);

export default router;
